package cn.iocoder.yudao.module.crm.dal.mysql.performance.person;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.crm.controller.admin.performance.person.vo.PersonPerformanceConfigDetailPageReqVO;
import cn.iocoder.yudao.module.crm.dal.dataobject.performance.person.PersonPerformanceConfigDetailDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * CRM_业绩配置 Mapper
 *
 * @author 超级管理员
 */


/**
 * CRM_业绩配置 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface PersonPerformanceConfigDetailMapper extends BaseMapperX<PersonPerformanceConfigDetailDO> {

    default PageResult<PersonPerformanceConfigDetailDO> selectPage(PersonPerformanceConfigDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PersonPerformanceConfigDetailDO>()
                .inIfPresent(PersonPerformanceConfigDetailDO::getUserId, reqVO.getUserId())
                .inIfPresent(PersonPerformanceConfigDetailDO::getPerformancePoint, reqVO.getPerformancePoint())
                .betweenIfPresent(PersonPerformanceConfigDetailDO::getBelongMonth, reqVO.getBelongMonth())
                .eqIfPresent(PersonPerformanceConfigDetailDO::getTargetValue, reqVO.getTargetValue())
                .orderByDesc(PersonPerformanceConfigDetailDO::getId));
    }

}